import React from 'react'
import style from './customInput.module.scss'
import { Input } from 'antd'

export type TCustomInput<T> = {
  baseData: T & object
  changeBaseData: (data: T) => {}
}

export default function CustomInput<T>({baseData, changeBaseData}: TCustomInput<T>) {
  return (
    <div className={style.wrapper}>
      {
        typeof baseData === 'object' && Object.keys(baseData).map((item:string) => {
          switch (item){
            case 'string': {
              return <Input
                key={item}
                value={"baseData['qwe']"}
                placeholder={item}
                onChange={e => changeBaseData({...baseData, [item]: e.target.value})}
              />
            }
              break
            default: return null
          }

        })
      }
    </div>
  )
}
